﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace IntelliTouchMix
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();

            expandableSplitter1.Visible = false;
            expandableSplitter2.Visible = false;
            expandableSplitter3.Visible = false;
           // expandableSplitter4.Visible = false;
        }


        private void buttonX1_Click(object sender, EventArgs e)
        {

            this.expandableSplitter1.ExpandableControl = this.panelEx1;
            this.expandableSplitter3.ExpandableControl = this.panelEx2;
            this.expandableSplitter2.ExpandableControl = this.panelEx3;
            // expandableSplitter3.ExpandableControl = panelEx4;
            //expandableSplitter3.Dock = DockStyle.Top;
            //panelEx4.Dock = DockStyle.Top;
            //panelEx2.Dock = DockStyle.Fill;

            expandableSplitter1.Visible = true;
            expandableSplitter2.Visible = true;
            expandableSplitter3.Visible = true;
            //expandableSplitter4.Visible = true;
            //panelEx4.Dock = DockStyle.Right;
            // panelEx3.Dock = DockStyle.Fill;
            panelEx4.Dock = DockStyle.Fill;
            expandableSplitter3.ExpandableControl = panelEx2;
            expandableSplitter3.Dock = DockStyle.Bottom;
            panelEx2.Dock = DockStyle.Bottom;
            expandableSplitter1.Expanded = false;
            //expandableSplitter2.Expanded = false;
            expandableSplitter3.Expanded = false;
            //expandableSplitter4.Expanded = false;
            expandableSplitter1.Visible = false;
            expandableSplitter2.Visible = false;
            expandableSplitter3.Visible = false;
            //expandableSplitter4.Visible = false;
            //expandableSplitter1.ExpandableControl = panelEx4;
            //expandableSplitter1.Dock = DockStyle.Right;

        }

        private void buttonX2_Click(object sender, EventArgs e)
        {

            /*this.expandableSplitter1.ExpandableControl = this.panelEx1;
            this.expandableSplitter3.ExpandableControl = this.panelEx2;
            this.expandableSplitter2.ExpandableControl = this.panelEx3;*/
          expandableSplitter3.Dock = DockStyle.Top;
            panelEx4.Dock = DockStyle.Top;
            panelEx2.Dock = DockStyle.Fill;
            panelEx2.BringToFront();
            expandableSplitter3.ExpandableControl = panelEx4;
            expandableSplitter1.Visible = true;
            expandableSplitter2.Visible = true;
            expandableSplitter3.Visible = true;

          //  expandableSplitter1.Expanded = false;
          //  expandableSplitter3.Expanded = true;
           expandableSplitter1.Expanded = false;
           expandableSplitter3.Expanded = false;

           expandableSplitter1.Visible = false;
           expandableSplitter2.Visible = false;
           expandableSplitter3.Visible = false;
        }
        private void buttonX5_Click(object sender, EventArgs e)
        {
            // panelEx2.Dock = DockStyle.Bottom;
            def();
        }

        private void buttonX6_Click_1(object sender, EventArgs e)
        {
            def();
        }
        private void def()
        {
            expandableSplitter1.Visible = true;
            expandableSplitter2.Visible = true;
            expandableSplitter3.Visible = true;
            expandableSplitter2.Dock = System.Windows.Forms.DockStyle.Top;
         //   this.expandableSplitter2.ExpandableControl = this.panelEx3;
            expandableSplitter1.Dock = System.Windows.Forms.DockStyle.Left;
         //   this.expandableSplitter1.ExpandableControl = this.panelEx1;
            expandableSplitter3.Dock = DockStyle.Bottom;
            //this.expandableSplitter3.ExpandableControl = this.panelEx2;
            
            panelEx3.Dock = System.Windows.Forms.DockStyle.Top;
            panelEx2.Dock = DockStyle.Bottom;
            panelEx1.Dock = System.Windows.Forms.DockStyle.Left;
            //Controls.Add(panelEx4);
            panelEx4.Dock = DockStyle.Fill;
            /*
            */

            expandableSplitter1.Expanded = true;
            expandableSplitter3.Expanded = true;
            expandableSplitter2.Expanded = true;
            expandableSplitter1.Visible = false;
            expandableSplitter2.Visible = false;
            expandableSplitter3.Visible = false;
        }
        private void buttonX4_Click(object sender, EventArgs e)
        {

            this.expandableSplitter1.ExpandableControl = this.panelEx4;
            this.expandableSplitter3.ExpandableControl = this.panelEx2;
            this.expandableSplitter2.ExpandableControl = this.panelEx1;
            panelEx4.Dock = DockStyle.Right;
            expandableSplitter1.Dock = DockStyle.Right;
            expandableSplitter3.Dock = DockStyle.Bottom;
            panelEx1.Dock = DockStyle.Bottom;
            panelEx2.Dock = DockStyle.Bottom;
            expandableSplitter3.Dock = DockStyle.Top;
            expandableSplitter1.Expanded = false;
            // expandableSplitter2.Expanded = false;
            expandableSplitter3.Expanded = false;
            panelEx3.Dock = DockStyle.Top;
            panelEx1.Hide();
            Controls.Add(panelEx3);
            panelEx1.Controls.Remove(panelEx3);
            panelEx3.Size = new Size(Width, Height);// += 80;

            /*
            expandableSplitter1.Visible = true;
            expandableSplitter2.Visible = true;
            expandableSplitter3.Visible = true;
            expandableSplitter1.Dock = System.Windows.Forms.DockStyle.Right;
            expandableSplitter2.Dock = System.Windows.Forms.DockStyle.Bottom;
            expandableSplitter3.Dock = DockStyle.Bottom;

            panelEx4.Dock = DockStyle.Fill;
            panelEx3.Dock = System.Windows.Forms.DockStyle.Top;
            panelEx2.Dock = DockStyle.Bottom;
            panelEx1.Dock = System.Windows.Forms.DockStyle.Left;

            expandableSplitter1.Expanded = true;
            expandableSplitter3.Expanded = true;
            expandableSplitter2.Expanded = true;
            expandableSplitter1.Visible = false;
            expandableSplitter2.Visible = false;
            expandableSplitter3.Visible = false;
            /*
            expandableSplitter1.ExpandableControl = panelEx4;
            expandableSplitter3.ExpandableControl = panelEx2;
            expandableSplitter2.ExpandableControl = panelEx1;

            expandableSplitter3.Dock = DockStyle.Bottom;
            panelEx2.Dock = DockStyle.Bottom;

            expandableSplitter1.Dock = DockStyle.Right;
            panelEx4.Dock = DockStyle.Right;
            panelEx1.Dock = DockStyle.Bottom;
            
            /*
            expandableSplitter3.Dock = DockStyle.Bottom;
            panelEx2.Dock = DockStyle.Bottom;
            expandableSplitter1.Dock = DockStyle.Right;
            
            // panelEx4.Dock = DockStyle.Right;
            panelEx3.Dock = DockStyle.Top;
            //panelEx3.Size.Height = 400;//Height;
            expandableSplitter1.Visible = true;
            expandableSplitter2.Visible = true;
            expandableSplitter3.Visible = true;
            expandableSplitter1.Expanded = false;
            expandableSplitter2.Expanded = false;
            expandableSplitter3.Expanded = false;
            panelEx3.Dock = DockStyle.Fill;
            //Controls.Add(panelEx3);
            //panelEx1.Controls.Remove(panelEx3);
            expandableSplitter1.Visible = false;
            expandableSplitter2.Visible = false;
            expandableSplitter3.Visible = false;
          //  expandableSplitter1.Visible = false;
          //  expandableSplitter2.Visible = false;
            /*
            expandableSplitter1.Expanded = false;
            expandableSplitter2.Expanded = false;
            expandableSplitter3.Expanded = false;
            expandableSplitter4.Expanded = false;*/
        }

        private void buttonX7_Click(object sender, EventArgs e)
        {
            panelEx3.Size = new Size(Width / 2, (Height / 2)-25);// += 80;
            //panelEx2.Size = new Size(Width / 2, Height / 2);// += 80;
            panelEx1.Show();

            Controls.Remove(panelEx3);
            panelEx1.Controls.Add(panelEx3);
            def();
            
            //Controls.Remove(panelEx3);
            //panelEx1.Controls.Add(panelEx3);
        }

        private void buttonX8_Click(object sender, EventArgs e)
        {
            def();
        }

        private void buttonX3_Click(object sender, EventArgs e)
        {
            this.expandableSplitter1.ExpandableControl = this.panelEx4;
            this.expandableSplitter3.ExpandableControl = this.panelEx2;
            this.expandableSplitter2.ExpandableControl = this.panelEx3;
            panelEx4.Dock = DockStyle.Right;
            expandableSplitter1.Dock = DockStyle.Right;
            expandableSplitter3.Dock = DockStyle.Bottom;
            panelEx2.Dock = DockStyle.Bottom;
            expandableSplitter3.Dock = DockStyle.Top;
            expandableSplitter1.Expanded = false;
            expandableSplitter2.Expanded = false;
            expandableSplitter3.Expanded = false;
            panelEx1.Dock = DockStyle.Fill;

        }

        
    }
}
